import subprocess
import sys
import os

def install_package(package):
    print(f"正在安装 {package}...")
    subprocess.check_call([sys.executable, "-m", "pip", "install", package])

def main():
    print("正在安装Cursor注册界面的依赖...")
    
    # 必要的第三方依赖
    packages = [
        "PyQt5",
        "omegaconf",
        "DrissionPage",
        "hydra-core",
        "faker",
        "beautifulsoup4"
    ]
    
    for package in packages:
        try:
            install_package(package)
        except Exception as e:
            print(f"安装 {package} 时出错: {str(e)}")
            print("请尝试手动安装: pip install " + package)
    
    print("\n依赖安装完成！")
    print("现在可以运行 'python main.py' 启动图形界面。")

if __name__ == "__main__":
    main() 